In a known image forming apparatus, an interlock switch is disposed in a casing. The interlock switch is configured to be switched between on and off by opening and closing an opening-and-closing member. More specifically, the opening-and-closing member is provided with a protruding pressing portion. As the opening-and-closing member is closed, the pressing portion is inserted into a hole provided in the casing and presses the interlock switch.
The image forming apparatus includes a restricting member having an opening smaller than the hole of the casing. The restricting member is disposed between the hole of the casing and the interlock switch to move in a direction intersecting a direction in which the pressing portion passes through the hole of the casing. In the image forming apparatus, the interlock switch may be pressed as the pressing portion of the opening-and-closing member inserted into the hole of the casing passes through the opening of the restricting member while moving the restricting member. Thus, malfunction of the image forming apparatus caused by a user pressing the interlock switch with his/her finger as the opening-and-closing member is open, may be prevented. However, the interlock switch is able to be pressed by inserting, for example, a rod, into the hole when the opening-and-closing member is open.